package com.s53.crm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Common {
    private int code;
    private String msg;
    private Object data;

    public static Common success() {
        return new Common(200, "success", null);
    }

    public static Common success(Object data) {
        return new Common(200, "success", data);
    }

    public static Common error() {
        return new Common(500, "error", null);
    }

    public static Common error(int code, String msg) {
        return new Common(500, msg, null);
    }
}
